package com.jwthhealth_pub.old.subscribe;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.webkit.WebResourceRequest;
import android.webkit.WebView;
import android.webkit.WebViewClient;


import com.jwthhealth_pub.R;
import com.jwthhealth_pub.common.base.BaseActivity;
import com.jwthhealth_pub.common.view.TitleLayout;
import com.jwthhealth_pub.old.api.ApiHelper;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * 项目简介页面
 * Created by Administrator on 2017/9/11.
 */

public class SubscribeSummaryActivity extends BaseActivity {
    @BindView(R.id.title_layout)
    TitleLayout titleLayout;
    @BindView(R.id.wv)
    WebView wv;
    private Intent mIntent;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_subscribe_nav);
        ButterKnife.bind(this);

        mIntent = getIntent();

        WebView wv = (WebView) findViewById(R.id.wv);
//        LogUtil.i(ApiHelper.BASE_NAV_URL + "appointment/web-p/pos-map?id="+id, TAG);
        wv.loadUrl(ApiHelper.BASE_NAV_URL + "/appointment/web-p/poj-html?id="+mIntent.getStringExtra("id"));
        wv.getSettings().setJavaScriptEnabled(true);
        wv.setWebViewClient(new WebViewClient(){
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
                return false;
            }
        });
    }

    @Override
    public void title() {
        titleLayout.setTitle(mIntent.getStringExtra("title"));
        titleLayout.setOnTitleLayoutListener(new TitleLayout.TitleLayoutListener() {
            @Override
            public void leftclick() {
                finish();
            }

            @Override
            public void leftTextClick() {

            }

            @Override
            public void rightclick() {

            }

            @Override
            public void rightTextClick() {

            }
        });
    }
}
